<#assign category_orl = param.value('category_orl')?if_exists>
<#assign sch_type = param.value('sch_type')?if_exists>
<#assign sch_value = param.value('sch_value')?if_exists>

<script type="text/javascript">//<![CDATA[

jQuery(function() {

  <#if MM.options_is_category?if_exists == 'Y'>
  // 카테고리 호출 listCategory 도 같이 사용할 수 있음
  jQuery.category.select_box('#category_orl','${MODULE_ORL}','${category_orl}');
  </#if>

  jQuery.ja.setValue('#form_search #sch_type','${sch_type}');

  // parameter input create
  jQuery.jaAction.paramCreateInput('#form_search','${param.get('?')?js_string}');

  jQuery('#category_orl').change(function() {
    location.href="dispDocumentList.me${param.get('?category_orl=')?js_string}&category_orl=" + jQuery(this).val();
  });

});

//]]></script>

<div id="sub_column_content">
<#include "admin.sub.html">
<#include "_head.html">
  <form id="form" method="get" action="?">
  <div class="document-list">
  <table cellspacing="0" border="1" summary="" class="table-list">
  <colgroup>
  <col width="80"><col><col width="115"><col width="85"><col width="60">
  </colgroup>
  <caption>Total ${paging.total_count?string(",###")} Page ${paging.page?string(",###")}/${paging.total_page?string(",###")}
    <ul>
      <li><a href="./dispDocumentList.me${param.get('?list_style=list')?html}"><span class="iconset style_list"></span></a></li>
      <li><a href="./dispDocumentList.me${param.get('?list_style=gallery')?html}"><span class="iconset style_gallery"></span></a></li>

      <#if MM.options_is_category?if_exists == 'Y'>
      <li>
        <select name="category_orl" id="category_orl">
          <option value="">전체</option>
        </select>
      </li>
      </#if>

    </ul>
  </caption>
  <thead>
    <tr>
      <th scope="col">번호</th>
      <th scope="col">제목</th>
      <th scope="col">작성자</th>
      <th scope="col">등록일</th>
      <th scope="col">조회수</th>
    </tr>
  </thead>
  <tbody>

    <#assign i = 0>
    <#list O.listDocument as obj>

    <#assign title_style = "">
    <#if obj.title_bold == 'Y'><#assign title_style = "font-weight :bold;"></#if>
    <#if obj.title_color?exists><#assign title_style = "${title_style} color :#${obj.title_color};"></#if>

    <#if MM.options_is_reply?if_exists == 'Y' && obj.parent_orl?number != 0>
    <tr class="reply"><#else><tr></#if>
      <td><#if obj.is_notice == 'Y'><b>공지</b><#else>${paging.virtual_idx - i}</#if></td>
      <td class="title" <#if MM.options_is_reply?if_exists == 'Y' && obj.reply_depth?number != 0>style="padding-left:${obj.reply_depth}0px;"</#if>>
      <#if obj.category_title != ""> <span class="category">${obj.category_title} <span>|</span> </span></#if>
      <a href="./dispDocumentView.me${param.get('?document_orl=${obj.document_orl}')?html}"><span style="${title_style}">${obj.title}</span></a>
      <#if obj.comment_count?number &gt; 0> <span class="comment">[${obj.comment_count}]</span></#if>
      <#if obj.document_new><img width="10" height="9" class="icon" alt="새글" src="${MOD_FTL_MODULE_SKIN}/images/ic_new.png" /></#if>
      <#if obj.file_count?number &gt; 0><img width="16" height="16" class="icon" alt="첨부파일" src="${MOD_FTL_MODULE_SKIN}/images/ic_file.png" /></#if>
      </td>
      <td>${obj.nickname}</td>
      <td><#if obj.regdate != ""><#assign regdate = obj.regdate?datetime("yyyyMMddHHmmss")>${regdate?string("yyyy/MM/dd")}</#if></td>
      <td>${obj.readed_count}</td>
    </tr>
    <#assign i = i + 1>
    </#list>
    <#if paging.total_count == 0>
    <tr><td colspan="5" class="zero">등록된 자료가 없습니다.</td></tr>
    </#if>

  </tbody>
  </table>
  </div>

  <div class="document-foot-menu">
  <#if MEI_GRANT_WRITE>
  <span class="button medium"><a href="./dispDocumentInsert.me${param.get('?')?html}">등록</a></span>
  </#if>
  </div>

  <@pagenavigator url = param.get('?page=')?j_string form="#form" params = paging />
  </form>

  <div class="document-search tc">
  <form id="form_search" method="get" action="?">
    <fieldset>
        <select id="sch_type" name="sch_type">
          <option value="">검색</option>
          <option value="title">제목</option>
          <option value="content_text">내용</option>
        </select>
       <input type="text" class="i_search w200" id="sch_value" name="sch_value" value="${param.value('sch_value')?if_exists?html}" />
       <span class="button medium"><input type="submit" value="검색" /></span>
    </fieldset>
  </form>
  </div>

<#include "_foot.html">
</div>